import instance from "@/utils/Request";

// 获取房源接口
export const getHouse = (data: any) => {
    return instance.get("/housing", { params: data })
}
export const getSecondHouse = (data: any) => {
    return instance.get("/second/housing", { params: data })
}

// 删除接口
export const deleteHouse = (id: any) => {
    return instance.delete(`/deleteMarkethouses/${id}`)
}
export const deleteSecondHouse = (id: any) => {
    return instance.delete(`/deleteRenthouses/${id}`)
}

// 添加接口
export const addHouse = (data: any) => {
    return instance.post('/addHouse', data)
}

// 编辑接口
export const editHouse = (data: any) => {
    return instance.post("/editHouses", data)
}

// 获取直播接口
export const getLive = (pageCount: any) => {
    return instance.get("/live", { params: { pageCount } })
}

// 直播接口
export const getLiveZhibo = (status: any) => {
    return instance.get("/live", { params: { ...status } })
}

// 直播搜索接口
export const searchLive = (data: any) => {
    return instance.get("/live", { params: { ...data } })
}

// 删除直播接口
export const delLive = (id: number) => {
    return instance.delete(`/delLive`, { params: { id } })
}

// 团购管理接口
export const getGroup = (data: any) => {
    return instance.get('/api/v1/group', { params: data })
}

// 删除团购接口
export const delGroup = (id: any) => {
    return instance.delete(`/api/v1/group/${id}`)
}

// 更新团购接口
export const updateGroup = (data: any) => {
    return instance.put(`/api/v1/group/${data.id}`, { status: data.status })
}

// 审核管理接口
export const getAudit = (data: any) => {
    return instance.get('/api/v1/audit', { params: data })
}

// 订单管理接口
export const getOrder = (uid: any) => {
    return instance.get('/api/v1/order', { params: uid })
}

// 资讯管理接口
export const getInfos = (data: any) => {
    return instance.get('/api/v1/infos', { params: data })
}

// 删除资讯管理接口
export const delInfos = (id: any) => {
    return instance.delete(`/api/v1/infos/${id}`)
}

// 更新资讯管理接口
export const updateInfos = (obj: any) => {
    return instance.put(`/api/v1/infos/${obj.id}`, { ...obj })
}

// 新增资讯管理接口
export const addInfos = (obj: any) => {
    return instance.post(`/api/v1/infos`, obj)
}

// 获取经纪人管理接口
export const getBroker = () => {
    return instance.get('/api/v1/broker')
}